library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
library altera;
use altera.altera_primitives_components.all;

entity shiftdecode is
	port(enable: in std_logic;
		e: in std_logic_vector(0 to 31);
		d: out std_logic_vector(0 to 31));
end shiftdecode;

architecture struc of shiftdecode is
begin
--	d(0)<=not (e(4) or e(3) or e(2) or e(1) or e(0));
--	d(1)<=not (e(4) or e(3) or e(2) or e(1));
--	d(2)<=not (e(4) or e(3) or e(2) or (e(1) and e(0)));
--	d(3)<=not (e(4) or e(3) or e(2));
--	d(4)<=not (e(4) or e(3) or (e(2) and e(1)) or (e(2) and e(0)));
--	d(5)<=not (e(4) or e(3) or (e(2) and e(1)));
--	d(6)<=not (e(4) or e(3) or (e(2) and e(1) and e(0)));
--	d(7)<=not (e(4) or e(3));
--	d(8)<=not (e(4) or (e(3) and e(2)) or (e(3) and e(1)) or (e(3) and e(0)));
--	d(9)<=not (e(4) or (e(3) and e(2)) or (e(3) and e(1)));
--	d(10)<=not (e(4) or (e(3) and e(2)) or (e(3) and e(1) and e(0)));
--	d(11)<=not (e(4) or (e(3) and e(2)));
--	d(12)<=not (e(4) or (e(3) and e(2) and e(1)) or (e(3) and e(2) and e(0)));
--	d(13)<=not (e(4) or (e(3) and e(2) and e(1)));
--	d(14)<=not (e(4) or (e(3) and e(2) and e(1) and e(0)));
--	d(15)<=not e(4);
--	d(16)<=not e(4) or (not e(3) and not e(2) and not e(1) and not e(0));
--	d(17)<=not e(4) or (not e(3) and not e(2) and not e(1));
--	d(18)<=not ((e(4) and e(3)) or (e(4) and e(2)) or (e(4) and e(1) and e(0)));
--	d(19)<=not ((e(4) and e(3)) or (e(4) and e(2)));
--	d(20)<=not e(4) or (not e(3) and not e(2)) or (not e(3) and not e(1) and not e(0));
--	d(21)<=not ((e(4) and e(3)) or (e(4) and e(2) and e(1)));
--	d(22)<=not ((e(4) and e(3)) or (e(4) and e(2) and e(1) and e(0)));
--	d(23)<=not (e(4) and e(3));
--	d(24)<=not e(4) or not e(3) or (not e(2) and not e(1) and not e(0));
--	d(25)<=not ((e(4) and e(3) and e(2)) or (e(4) and e(3) and e(1)));
--	d(26)<=not ((e(4) and e(3) and e(2)) or (e(4) and e(3) and e(1) and e(0)));
--	d(27)<=not (e(4) and e(3) and e(2));
--	d(28)<=not e(4) or not e(3) or not e(2) or (not e(1) and not e(0));
--	d(29)<=not (e(4) and e(3) and e(2) and e(1));
--	d(30)<=not (e(4) and e(3) and e(2) and e(1) and e(0));
--	d(31)<='1';
d(0)<=e(0);
d(1)<=e(0) or e(1);
d(2)<=e(0) or e(1) or e(2);
d(3)<=e(0) or e(1) or e(2) or e(3);
d(4)<=e(0) or e(1) or e(2) or e(3) or e(4);
d(5)<=e(0) or e(1) or e(2) or e(3) or e(4) or e(5);
d(6)<=e(0) or e(1) or e(2) or e(3) or e(4) or e(5) or e(6);
d(7)<=e(0) or e(1) or e(2) or e(3) or e(4) or e(5) or e(6) or e(7);
d(8)<=e(0) or e(1) or e(2) or e(3) or e(4) or e(5) or e(6) or e(7) or e(8);
d(9)<=e(0) or e(1) or e(2) or e(3) or e(4) or e(5) or e(6) or e(7) or e(8) or e(9);
d(10)<=e(0) or e(1) or e(2) or e(3) or e(4) or e(5) or e(6) or e(7) or e(8) or e(9) or e(10);
d(11)<=e(0) or e(1) or e(2) or e(3) or e(4) or e(5) or e(6) or e(7) or e(8) or e(9) or e(10) or e(11);
d(12)<=e(0) or e(1) or e(2) or e(3) or e(4) or e(5) or e(6) or e(7) or e(8) or e(9) or e(10) or e(11) or e(12);
d(13)<=e(0) or e(1) or e(2) or e(3) or e(4) or e(5) or e(6) or e(7) or e(8) or e(9) or e(10) or e(11) or e(12) or e(13);
d(14)<=e(0) or e(1) or e(2) or e(3) or e(4) or e(5) or e(6) or e(7) or e(8) or e(9) or e(10) or e(11) or e(12) or e(13) or e(14);
d(15)<=e(0) or e(1) or e(2) or e(3) or e(4) or e(5) or e(6) or e(7) or e(8) or e(9) or e(10) or e(11) or e(12) or e(13) or e(14) or e(15);
d(16)<=e(0) or e(1) or e(2) or e(3) or e(4) or e(5) or e(6) or e(7) or e(8) or e(9) or e(10) or e(11) or e(12) or e(13) or e(14) or e(15) or e(16);
d(17)<=e(0) or e(1) or e(2) or e(3) or e(4) or e(5) or e(6) or e(7) or e(8) or e(9) or e(10) or e(11) or e(12) or e(13) or e(14) or e(15) or e(16) or e(17); 
d(18)<=e(0) or e(1) or e(2) or e(3) or e(4) or e(5) or e(6) or e(7) or e(8) or e(9) or e(10) or e(11) or e(12) or e(13) or e(14) or e(15) or e(16) or e(17) or e(18);
d(19)<=e(0) or e(1) or e(2) or e(3) or e(4) or e(5) or e(6) or e(7) or e(8) or e(9) or e(10) or e(11) or e(12) or e(13) or e(14) or e(15) or e(16) or e(17) or e(18) or e(19);
d(20)<=e(0) or e(1) or e(2) or e(3) or e(4) or e(5) or e(6) or e(7) or e(8) or e(9) or e(10) or e(11) or e(12) or e(13) or e(14) or e(15) or e(16) or e(17) or e(18) or e(19) or e(20);
d(21)<=e(0) or e(1) or e(2) or e(3) or e(4) or e(5) or e(6) or e(7) or e(8) or e(9) or e(10) or e(11) or e(12) or e(13) or e(14) or e(15) or e(16) or e(17) or e(18) or e(19) or e(20) or e(21);
d(22)<=e(0) or e(1) or e(2) or e(3) or e(4) or e(5) or e(6) or e(7) or e(8) or e(9) or e(10) or e(11) or e(12) or e(13) or e(14) or e(15) or e(16) or e(17) or e(18) or e(19) or e(20) or e(21) or e(22);
d(23)<=e(0) or e(1) or e(2) or e(3) or e(4) or e(5) or e(6) or e(7) or e(8) or e(9) or e(10) or e(11) or e(12) or e(13) or e(14) or e(15) or e(16) or e(17) or e(18) or e(19) or e(20) or e(21) or e(22) or e(23);
d(24)<=e(0) or e(1) or e(2) or e(3) or e(4) or e(5) or e(6) or e(7) or e(8) or e(9) or e(10) or e(11) or e(12) or e(13) or e(14) or e(15) or e(16) or e(17) or e(18) or e(19) or e(20) or e(21) or e(22) or e(23) or e(24);
d(25)<=e(0) or e(1) or e(2) or e(3) or e(4) or e(5) or e(6) or e(7) or e(8) or e(9) or e(10) or e(11) or e(12) or e(13) or e(14) or e(15) or e(16) or e(17) or e(18) or e(19) or e(20) or e(21) or e(22) or e(23) or e(24) or e(25); 
d(26)<=e(0) or e(1) or e(2) or e(3) or e(4) or e(5) or e(6) or e(7) or e(8) or e(9) or e(10) or e(11) or e(12) or e(13) or e(14) or e(15) or e(16) or e(17) or e(18) or e(19) or e(20) or e(21) or e(22) or e(23) or e(24) or e(25) or e(26);
d(27)<=e(0) or e(1) or e(2) or e(3) or e(4) or e(5) or e(6) or e(7) or e(8) or e(9) or e(10) or e(11) or e(12) or e(13) or e(14) or e(15) or e(16) or e(17) or e(18) or e(19) or e(20) or e(21) or e(22) or e(23) or e(24) or e(25) or e(26) or e(27);
d(28)<=e(0) or e(1) or e(2) or e(3) or e(4) or e(5) or e(6) or e(7) or e(8) or e(9) or e(10) or e(11) or e(12) or e(13) or e(14) or e(15) or e(16) or e(17) or e(18) or e(19) or e(20) or e(21) or e(22) or e(23) or e(24) or e(25) or e(26) or e(27) or e(28);
d(29)<=e(0) or e(1) or e(2) or e(3) or e(4) or e(5) or e(6) or e(7) or e(8) or e(9) or e(10) or e(11) or e(12) or e(13) or e(14) or e(15) or e(16) or e(17) or e(18) or e(19) or e(20) or e(21) or e(22) or e(23) or e(24) or e(25) or e(26) or e(27) or e(28) or e(29);
d(30)<=e(0) or e(1) or e(2) or e(3) or e(4) or e(5) or e(6) or e(7) or e(8) or e(9) or e(10) or e(11) or e(12) or e(13) or e(14) or e(15) or e(16) or e(17) or e(18) or e(19) or e(20) or e(21) or e(22) or e(23) or e(24) or e(25) or e(26) or e(27) or e(28) or e(29) or e(30);
d(31)<='0';
end struc;